package com.lj.api.tools.Qniu;

import net.sf.json.JSONObject;

import java.io.IOException;

public class QNiuImageSetting {
    public static final String USER_IMAGE_SETTING="?imageView2/1/w/300/h/300/format/jpg/interlace/1/q/60";
    public static final String PNG_IMAGE_SETTING="?imageView2/1/w/300/h/300/format/png/interlace/1/q/60";
    public static final String COMMENT_lIST_IMAGE_SETTING="?imageView2/1/w/300/h/300/format/jpg/interlace/1/q/60";
    public static final String COMMENT_DETAIL_IMAGE_SETTING="?imageView2/2/w/1280/h/1280/format/jpg/interlace/0/q/60";
    public static final String GOODS_DETAIL_IMAGE_SETTING="?imageView2/2/w/1080/h/1080/format/jpg/interlace/0/q/60";
    public static final String GOODS_IMAGE_SETTING="?imageView2/2/w/300/h/300/format/jpg/interlace/0/q/60";
    public static final String COMMENT_NUTRIELE_IMAGE_SETTING="?imageView2/0/h/1080/format/png/interlace/0/60";
    public static final String IMAGE_DETALL = "?imageView2/2/w/1280/format/jpg/interlace/0/q/60";
    public static final String VIDEO_IMG="?vframe/jpg/w/1080/offset/";

    public static final String IMAGE_LIB_SETTING="?imageView2/2/w/720/h/720/format/jpg/interlace/0/q/60";
    public static final String QiNiu_prefop_url = "http://api.qiniu.com/status/get/prefop";

    /*public static String prefop(String id) {
        String url = QiNiu_prefop_url+"?id="+id;
        String msg = null;
        try {
            msg = HttpClientPostMethod.get(url,null,null);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return msg;
    }


    public static String prefopRecursion(String id,int i) {

        for(int y= 0 ;y<i;y++){
            String url = QiNiu_prefop_url+"?id="+id;
            String msg = null;
            try {
                msg = HttpClientPostMethod.get(url,null,null);
                JSONObject jsonObject = JSONObject.fromObject(msg);
                int code = jsonObject.getInt("code");
                if (code==0){
                    return msg;
                }else{
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    continue;
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return null;
    }*/

}

